<?php get_header(); ?>

<!--分享到-->
<div class="share_more" id="share_more"
	style="position: absolute; left: 160px; top: 442px; display: none;"><span>
</span>
<p onmouseover="share_more_element.style.display='block';"
	onmouseout="share_more_element.style.display='none';"><a class="share">
分享到... </a> <a class="favorite" href="javascript:doShare('fav');"> 收藏夹 </a>
<a class="facebook" href="javascript:doShare('qqt');"> 腾讯微博 </a> <a
	class="baidu" href="javascript:doShare('qzone');"> QQ空间 </a> <a
	class="twitter" href="javascript:doShare('renren');"> 人人网 </a> <a
	class="myspace" href="javascript:doShare('douban');"> 豆瓣 </a></p>
</div>
<script type="text/javascript">
	var share_more_element = null;

	var share_postid = -1;

	var postArray = [];

	function getPos(obj) {

		var pos = [];

		pos[0] = obj.offsetLeft; //X
		pos[1] = obj.offsetTop; //Y
		while (obj = obj.offsetParent) {

			pos[0] += obj.offsetLeft;

			pos[1] += obj.offsetTop;

		}

		return pos;

	}

	function share_more(postid, obj) {

		share_postid = postid;

		var objPos = getPos(obj);

		objPos[0] -= 7;
		objPos[1] -= 5;

		if (share_more_element == null) share_more_element = document.getElementById("share_more");

		share_more_element.style.left = objPos[0] + "px";

		share_more_element.style.top = objPos[1] + "px";

		share_more_element.style.display = "block";

	}

	function doShare(stype) {

		stitle = postArray[share_postid][0];

		surl = postArray[share_postid][1];

		sdire = postArray[share_postid][2];

		sbanner = postArray[share_postid][3];

		blogtitle = '<?php bloginfo('name'); ?>';

		bloghome = '<?php bloginfo('url'); ?>';

		stitle = blogtitle + ' - ' + stitle;

		switch (stype) {

		case "fav":

			if (document.all) {

				window.external.addFavorite(surl, stitle);

			}

			else if (window.sidebar) {

				window.sidebar.addPanel(stitle, surl, "");

			}

			else {

				alert("抱歉,您的浏览器不支持添加到收藏夹,换个浏览器试试?");

			}

			break;

		case "qqt":

			u = encodeURIComponent(surl);

			t = encodeURIComponent('#<?php bloginfo('name'); ?>#：' + stitle);

			b = encodeURIComponent(sbanner);

			su = encodeURIComponent(bloghome);

			window.open('http://v.t.qq.com/share/share.php?title=' + t + '&url=' + u + '&source=1000012&site=' + su + '&pic=' + b, '_blank');

			break;

		case "qzone":

			var p = {

				url: surl,

				desc: "我在<?php bloginfo('name'); ?>（<?php bloginfo('url'); ?>）阅读了这篇文章，觉得不错，分享给大家：）",

				summary: sdire,

				title: stitle,

				site: '<?php bloginfo('name'); ?> <?php bloginfo('url'); ?>',

				pics: sbanner

			};

			var s = [];

			for (var i in p) {

				s.push(i + '=' + encodeURIComponent(p[i] || ''));

			}

			window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?' + s.join('&'));

			break;

		case "renren":

			u = encodeURIComponent(surl);

			t = encodeURIComponent(stitle);

			window.open('http://share.renren.com/share/buttonshare.do?link=' + u + '&title=' + t + 'source=&sourceUrl=', '_blank');

			break;

		case "douban":

			u = encodeURIComponent(surl);

			t = encodeURIComponent(stitle);

			window.open('http://www.douban.com/recommend/?url=' + u + '&title=' + t, '_blank');

			break;

		}

	}
</script>
<script>
	postArray[0] = [];
	postArray[0][0] = "<?php bloginfo('name'); ?>";
	postArray[0][1] = "<?php bloginfo('url'); ?>";
	postArray[0][2] = "<?php bloginfo('description'); ?>";
	postArray[0][3] = "";
</script>
<!--分享到 End-->

<!--当前位置-->

<div class="crumb"><a href="/">首页</a> &gt; <span><?php
if( is_category() ){
	single_cat_title();
} elseif ( is_tag() ){
	single_tag_title();
} elseif ( is_day() ){
	the_time('Y年Fj日');
} elseif ( is_month() ){
	the_time('Y年F');
} elseif ( is_year() ){
	the_time('Y年');
}
?></span></div>

<!--当前位置 End-->

<!--Container-->
<div id="container"><!--Content-->
<div id="content"><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!--content_text-->
<div class="content_text">
<div class="title"><a
	href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"
	class="avatar"> <?php echo get_avatar( get_the_author_email(), 43 ); ?>
<span> <?php echo get_avatar( get_the_author_email(), 43 ); ?> </span> </a>
<i class="line_h"> </i>
<h3><a href="<?php the_permalink() ?>"> <?php the_title(); ?> </a></h3>
<p><a
	href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"
	target="_blank"> <?php the_author_meta('display_name'); ?> </a> / <?php the_category(', '); ?>
/ <?php the_time('Y.m.d');?></p>
<a onfocus="this.blur()" class="up"
	href="<?php the_permalink() ?>#comments"> <?php comments_number('0', '1', '%' );?>
</a></div>
<!--content_banner--> <?php $postimg = get_post_meta($post->ID, "postimg_value", true); $postimg = trim(strip_tags($postimg)); ?>
<div class="content_banner"><?php if(!empty($postimg)){ ?> <a
	href="<?php the_permalink() ?>"> <img src="<?php echo $postimg; ?>" />
</a> <?php } ?>
<div class="text"><?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 250, "…"); ?>
</div>
</div>
<!--toolBar-->
<div class="toolBar">
<ul>
	<li class="browse">浏览:<?php echo getPostViews(get_the_ID()); ?></li>
	<li class="share" onmouseover="share_more(<?php the_ID(); ?>,this);"><a
		href="javascript:;"> 分享到... </a></li>
</ul>
<a href="<?php the_permalink() ?>" class="more"> 阅读全文 </a></div>
<script>
				postArray[<?php the_ID(); ?>] = [];
				postArray[<?php the_ID(); ?>][0] = "<?php the_title(); ?>  ";
				postArray[<?php the_ID(); ?>][1] = "<?php the_permalink() ?>";
				postArray[<?php the_ID(); ?>][2] = "　　<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 250, "…"); ?>";
				postArray[<?php the_ID(); ?>][3] = "<?php echo $postimg; ?>";
			</script></div>
<!--content_text End--> <?php endwhile;?><?php endif; ?> <!--Page-->
<div class="page"><?php par_pagenavi(9); ?> <a href="#top"
	class="back_top"> </a></div>
<!--Page End--></div>
<!--Content End--> <?php get_sidebar(); ?></div>
<!--Container End-->

<?php get_footer(); ?>